package com.atguigu.algorithm;

import java.util.Scanner;

public class AmericaFestival {
    //2000年的1月1号为星期六
    //1.1元旦
    //1月第三个星期一
    //2月的第三个星期一
    //5月最后一个星期一
    //7.4美国国庆
    //9月第一个星期一
    //11月第四个星期四
    //12.25日圣诞节
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextInt()){
            int year=scanner.nextInt(); //我们先判定当前年份的1月1日是星期几
            int period=0; //两者之间相差的天数
            for(int i=2000;i<year;i++){
                if(i%400==0 || (i%4==0 && i%100!=0)){
                    period+=366;
                }else{
                    period+=365;
                }
            }
            int twoMonth=28; //2月份的天数
            if(year%400==0 ||(year%4==0 &&year%100!=0)){
                twoMonth=29;
            }
            int week1=(period+6)%7; //1月1号是星期几
            int week2=(week1+31)%7; // 2月1号是星期几
            int week5=(week2+twoMonth+31+30)%7;
            int week9=(week5+31+30+31+31)%7;
            int week11=(week9+30+31)%7;
            int day=1;
            //week等于1则为星期1，为0则为星期天
            System.out.println(year+"-01-01"); //打印元旦节
            while(week1%7!=1){
                week1++;
                day++;
            }
            day+=14;
            System.out.println(year+"-01-"+day); //打印马丁路德金纪念日
            day=1;
            while(week2%7!=1){
                week2++;
                day++;
            }
            day+=14;
            System.out.println(year+"-02-"+day); //打印总统节
            day=31;
            week5=week5+30;
            while(week5%7!=1){
                week5--;
                day--;
            }
            System.out.println(year+"-05-"+day); //阵亡将士纪念日
            day=1;
            System.out.println(year+"-07-04"); //国庆
            while(week9%7!=1){
                week9++;
                day++;
            }
            if(day>=10) {
                System.out.println(year + "-09-" + day); //打印劳动节
            }
            else{
                System.out.println(year+"-09-0"+day);
            }
            day=1;
            while(week11%7!=4){
                week11++;
                day++;
            }
            day+=21;
            System.out.println(year+"-11-"+day);//打印感恩节
            System.out.println(year+"-12-25"); //打印圣诞节
            System.out.println();
        }
    }
}
